<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="/html/axios.min.js"></script>
    <script src="/html/util.js"></script>
    <script>
        window.onload = function (){
            getUserAccount();

            showType();
        }

        function getUserAccount(){

            axios.get("/user/getUserAcc",null).then(e=>{

                $("uSpan").innerText = e.data.acc;

                $("eSpan").innerText = e.data.email;
            });

        }
        function showType(){
            axios.get("/type/findAll",null).then(e =>{
                var info = e.data;
                var str ="";
                for(var i =0;i<info.length;i++){
                    var obj = info[i];
                    str +=`<tr><td><a href="/html/post.html?id=${obj.id}">${obj.name}
                    </a></td><td>${obj.describe}</td><td>${obj.postNum}</td></tr>`
                }
                $("type").innerHTML = str;
            })
        }


    </script>
</head>
<body>
        用户名:<span id="uSpan"></span>
        邮箱:<span id="eSpan"></span>
    <table border="1" cellspacing="0" width="60%">
        <thead><tr><th>频道名</th><th>频道描述</th><th>帖子数</th></tr></thead>
        <tbody id="type">
        </tbody>
    </table>
</body>
</html>